<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <css file="__PUBLIC__/css/base.css"/>
    <link type="text/css" href="__ROOT__/data/ui/css/flick/jquery-ui-1.8.23.custom.css" rel="stylesheet" />
    <script type="text/javascript" src="__ROOT__/data/ui/js/jquery-1.8.0.min.js"></script>
    <script type="text/javascript" src="__ROOT__/data/ui/js/jquery-ui-1.8.23.custom.min.js"></script>
    <script src="__DATA__/validate.min.js" language="javascript"></script>
	<script type="text/javascript">
        $(function(){
            $("#tabs").tabs();
        })
    </script>

</head>
<body marginleft="10">
    <div class="now_path">
        <strong>您现在的位置：</strong>
        添加友情链接
    </div>
	<div class="success_box">所有的选项都填写正确</div>
    <div class="error_box"></div>
    <form action="__CONTROL__/links_add_exe" method="post" enctype="multipart/form-data" name='links'>
        <input type="hidden" name="pid" value="<empty value='$hd.get.catid'>0<noempty>{$hd.get.catid}</empty>"/>
        <div id="tabs">
            <ul>
                <li><a href="#tabs-1">增加友情链接</a></li>
            </ul>
            <div id="tabs-1">
                <table class="table2">
                    <tr>
                        <th>网站关键词：</th>
                        <td><input type="text" name="fname" style="width:360px;"/></td>
                    </tr>
					<tr>
                        <th>logo</th>
                        <td><upload name='logo' size='1' text='上传logo' imagesize='120,70' type='jpg,png,bwm' dir='./upload/links' limit='1'/>
                    	</td>        
                    </tr>
                    <tr>
                        <th>指向url</th>
                        <td><input type="text" name="url" style="width:200px;"/>
                            <span class="desc"><font color="red">不要http://</font></span>
                    </tr>
                    <tr>
                        <th>是否显示：</th>
                        <td><input type="radio" name="stat" value="1" checked="checked"/>是&nbsp;&nbsp;
                            <input type="radio" name="stat" value="0"/>否</td>
                    </tr>
                    <tr>
                        <th>简介：</th>
                        <td><textarea style="height:60px;width:90%" name="msg"></textarea></td>
                    </tr>
                </table>
            </div>
            <div style="padding-left:100px;">
                <input type="submit" value="添加栏目" class="submit" name='submit'/>
            </div>
        </div>
	<script type='text/javascript'>
		var validator = new FormValidator('links', [{
		    name: 'fname',
		    display: '网站关键词',    
		    rules: 'required'
		},{
    		name: 'url',
			display: '指向URL',
    		rules: 'required'
		}], function(errors, event) {
		    var SELECTOR_ERRORS = $('.error_box'),
		        SELECTOR_SUCCESS = $('.success_box');
		        
			    if (errors.length > 0) {
			        SELECTOR_ERRORS.empty();
			        
			        for (var i = 0, errorLength = errors.length; i < errorLength; i++) {
			            SELECTOR_ERRORS.append(errors[i].message + '<br />');
			        }
			        
			        SELECTOR_SUCCESS.css({ display: 'none' });
			        SELECTOR_ERRORS.fadeIn(200);
			    } else {
			        SELECTOR_ERRORS.css({ display: 'none' });
			        SELECTOR_SUCCESS.fadeIn(200);
			    }
			    
			    if (event && event.preventDefault) {
			        event.preventDefault();
			    } else if (event) {
			        event.returnValue = false;
			    }
		});
	</script>
    </form>
</body>
</html>
